<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateContactTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateContactLabel_contactID}" for="contactID" />
                    <h:inputText id="contactID" value="#{contactController.selected.contactID}" title="#{bundle.CreateContactTitle_contactID}" />
                    <h:outputLabel value="#{bundle.CreateContactLabel_name}" for="name" />
                    <h:inputText id="name" value="#{contactController.selected.name}" title="#{bundle.CreateContactTitle_name}" required="true" requiredMessage="#{bundle.CreateContactRequiredMessage_name}"/>
                    <h:outputLabel value="#{bundle.CreateContactLabel_address}" for="address" />
                    <h:inputText id="address" value="#{contactController.selected.address}" title="#{bundle.CreateContactTitle_address}" required="true" requiredMessage="#{bundle.CreateContactRequiredMessage_address}"/>
                    <h:outputLabel value="#{bundle.CreateContactLabel_tell}" for="tell" />
                    <h:inputText id="tell" value="#{contactController.selected.tell}" title="#{bundle.CreateContactTitle_tell}" required="true" requiredMessage="#{bundle.CreateContactRequiredMessage_tell}"/>
                    <h:outputLabel value="#{bundle.CreateContactLabel_fax}" for="fax" />
                    <h:inputText id="fax" value="#{contactController.selected.fax}" title="#{bundle.CreateContactTitle_fax}" />
                    <h:outputLabel value="#{bundle.CreateContactLabel_email}" for="email" />
                    <h:inputText id="email" value="#{contactController.selected.email}" title="#{bundle.CreateContactTitle_email}" required="true" requiredMessage="#{bundle.CreateContactRequiredMessage_email}"/>
                    <h:outputLabel value="#{bundle.CreateContactLabel_question}" for="question" />
                    <h:inputText id="question" value="#{contactController.selected.question}" title="#{bundle.CreateContactTitle_question}" required="true" requiredMessage="#{bundle.CreateContactRequiredMessage_question}"/>
                    <h:outputLabel value="#{bundle.CreateContactLabel_comment}" for="comment" />
                    <h:inputText id="comment" value="#{contactController.selected.comment}" title="#{bundle.CreateContactTitle_comment}" required="true" requiredMessage="#{bundle.CreateContactRequiredMessage_comment}"/>
                    <h:outputLabel value="#{bundle.CreateContactLabel_dateCreated}" for="dateCreated" />
                    <h:inputText id="dateCreated" value="#{contactController.selected.dateCreated}" title="#{bundle.CreateContactTitle_dateCreated}" required="true" requiredMessage="#{bundle.CreateContactRequiredMessage_dateCreated}"/>
                    <h:outputLabel value="#{bundle.CreateContactLabel_isActive}" for="isActive" />
                    <h:inputText id="isActive" value="#{contactController.selected.isActive}" title="#{bundle.CreateContactTitle_isActive}" />
                    <h:outputLabel value="#{bundle.CreateContactLabel_approved}" for="approved" />
                    <h:inputText id="approved" value="#{contactController.selected.approved}" title="#{bundle.CreateContactTitle_approved}" />
                </h:panelGrid>
                <br />
                <h:commandLink action="#{contactController.create}" value="#{bundle.CreateContactSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{contactController.prepareList}" value="#{bundle.CreateContactShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateContactIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
